package com.haojin.java;
/*
 * 定义一个Circle，包含一个double型的radius代表圆的半径
 * 一个findArea（）方法返回圆的面积
 * 
 */
public class Circle {
	public static void main(String[] args) {
		Circle c = new Circle();
		PassObject printf = new PassObject();
		printf.printAreas(c,5);
		System.out.println();
		System.out.println("now radius is: "+c.radius);
	}
	
    double radius;
//    求圆的面积
    public double findArea(){
    	double areas = Math.PI * radius * radius;
    	return areas;
    }
}

class PassObject{
	public void printAreas(Circle c,int time){
		System.out.println("Radius\t"+ "\tAreas");
		int i;
		for( i =1;i <= time ;i++){
			c.radius = i;
			
			System.out.println(c.radius +"\t"+"\t"+ c.findArea());
		}
		c.radius = i;
		
	}
}
